import javax.swing.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public class test {
    public static void main(String[] args) {
        new A();
    }
}

class A extends JFrame implements KeyListener {
    public A() {
        this.addKeyListener(this);
        ee();
        setVisible(true);
    }

    public void ee() {
        setSize(514, 595);//设置窗体大小
        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//窗体默认关闭模式
        setTitle("石头迷阵单机版V1.0"); //设置窗体标题
        //setAlwaysOnTop(true);//设置窗体在最上层
        setLocationRelativeTo(null); //设置窗体居中显示

        setLayout(null);
    }

    @Override
    public void keyTyped(KeyEvent e) {

    }

    @Override
    public void keyPressed(KeyEvent e) {
        int keyChar = e.getKeyChar();
        System.out.println(keyChar);
    }

    @Override
    public void keyReleased(KeyEvent e) {

    }
}
